import Vue from 'vue'
import VueRouter from 'vue-router'
import Article from '@/views/article'
import Dashboard from '@/views/dashboard'
import Layout from '@/views/layout'
import Login from '@/views/login'
Vue.use(VueRouter)



const router = new VueRouter({
  routes:[
    //一级路由
    {
      path:'/',
      redirect:'/dashboard',
      component:Layout,
      //二级路由
      children:[
        {
          path:'/article',
          component:Article
        },
        {
          path:'/dashboard',
          component:Dashboard
        }
      ]
    },
    {
      path:'/login',
      component:Login
    }
  ]
})

export default router
